import sys
import time

a=time.time()
x=[k for k in range(10000000)]
b=time.time()
print(b-a)
print(sys.getsizeof(x))

c=time.time()
y=(k for k in range(10000000))
d=time.time()
print(d-c)
print(sys.getsizeof(y))



# import sys  
# import time

# t1=time.time()
# mylist = [i for i in range(10000000)]  
# t2=time.time()
# print("占用时间：",t2-t1)
# print("占用空间：",sys.getsizeof(mylist))  

# t3=time.time()
# mygen = (i for i in range(10000000))  
# t4=time.time()
# print("占用时间：",t4-t3)
# print("占用空间：",sys.getsizeof(mygen))